package com.swind.fast.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.swind.fast.common.interceptor.UserAppCodeInterceptor;

@Primary
@Configuration("swindFastWebConfig")
public class WebConfiguration implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(getUserAppCodeInterceptor());
    }

    @Bean
    UserAppCodeInterceptor getUserAppCodeInterceptor() {
        return new UserAppCodeInterceptor();
    }

}